package com.zhiyou100.service;

import com.zhiyou100.entity.Attendance;
import com.zhiyou100.mapper.AttendanceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AttendanceServiceImp  implements AttendanceService{
    @Autowired
    private AttendanceMapper attendanceMapper;
    public Attendance getOneById(Integer id) {
        Attendance attendance=new Attendance();
        attendance.setAid(id);
        return attendanceMapper.selectOne(attendance);
    }

    @Override
    public List<Attendance> getAll() {
        return attendanceMapper.selectAll();
    }

    @Override
    public int deleteOneById(Integer id) {
        return attendanceMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int updateOneById(Attendance attendance) {
        return attendanceMapper.updateByPrimaryKey(attendance);
    }
    @Override
    public int insertOne(Attendance attendance) {
        return attendanceMapper.insertSelective(attendance);
    }
}
